<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html; charset=UTF-8" language="java" %>
<jsp version="2.0" xmlns:c="http://java.sun.com/jsp/jstl/core"
     xmlns:jsp="http://java.sun.com/JSP/Page"
     xmlns="http://www.w3.org/1999/xhtml">
    <html>
    <head>
        <title></title>
        <script type="text/javascript"
                src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
        <script>
            $(document).ready(function() {
                $('.reference').click(function(event) {
                            var currentLink = $(this);
                            var href = currentLink.attr("href");
                            var id_acc = currentLink.attr("about");
                            href = href+"?id_acc="+id_acc;
                            $.get(href,function(responseData) {
                                $('#content_middle').html(responseData);
                            });
                            return false;
                        }
                );
            });
        </script>
    </head>
    <body>
    <p> Нажмите на номер счета чтобы просмотреть транзакции по нему</p>
    <table class="table">
        <tr>
            <td>Номер счета</td>
            <td>Сумма на счете</td>
        </tr>
        <c:forEach  var="d_data" items="${sessionScope.accs}">
            <tr>
                <td><a href="getTransactions" class="reference" about="${d_data.getId()}"> <c:out value="${d_data.getNumber()}"/></a></td>
                <td><c:out value="${d_data.getAmount()}"/></td>
            </tr>
        </c:forEach>
    </table>



    </body>
    </html>
</jsp>